using System;
using System.Data;

namespace CUtil
{
	/// <summary>
	/// Summary description for DataSetUtil.
	/// </summary>
	public class DataSetUtil
	{
		#region Constructors and Destructors

		public DataSetUtil()
		{
		}

		#endregion

		#region Methods Public

		/// <summary>
		/// FillDataSet
		/// </summary>
		/// <param name="parDataSet"></param>
		public static void FillDataSet(DataSet parDataSet)
		{
			if (parDataSet != null)
			{
				if ((parDataSet.Tables != null) && (parDataSet.Tables.Count >0))
				{
					DataTable locDataTable = parDataSet.Tables[0];
					for (int i=0;i<2;i++)
					{
						DataRow locDataRow = locDataTable.NewRow();
						for (int j=0;j<locDataRow.ItemArray.Length;j++)
						{
							try
							{
								locDataRow[j] 
									= "Value " + i.ToString()+ "-" + j.ToString();
							}
							catch (Exception exc)
							{
								System.Diagnostics.Debug.WriteLine
									("Error setting DataRowValue " 
									+"[" + i + "," + j + "]: "
									+ exc.Message);
							}
						}
						locDataTable.Rows.Add(locDataRow);
					}
				}
			}
		}

		#endregion
	}
}
